package test.externalRole;

import dk.au.cs.peterbn.annotations.Member;
import dk.au.cs.peterbn.annotations.Pattern;

import java.util.EventObject;

/**
 * Created by IntelliJ IDEA.
 * User: peter
 * Date: 9/19/11
 * Time: 3:50 PM
 * To change this template use File | Settings | File Templates.
 */
@Pattern(id = "test.externalRole", name = "gof:Observer/Push", role = "ConcreteSubject")
public class ConcreteSubject implements Subject {

    private Observer observer;

    @Override
    public void attach() {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public void detach() {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    @Member(id = "test.externalRole", role = "Notify")
    public void dispatchEvent() {
        observer = new ConcreteObserver();
        observer.update(new EventObject(this));
    }
}
